package com.shenmazong.serverwebpoem.service.impl;

import com.shenmazong.serverwebpoem.mapper.ITbAuthorMapper;
import com.shenmazong.serverwebpoem.pojo.TbAuthor;
import com.shenmazong.serverwebpoem.service.TbAuthorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 田不平
 * @project server-web-poem
 * @date 2020/3/24 9:36 AM
 * http://www.shenmazong.com
 */
@Slf4j
@Service
public class TbAuthorServiceImpl implements TbAuthorService {

    @Autowired
    ITbAuthorMapper iTbAuthorMapper;

    @Override
    public void add(TbAuthor author) {
        iTbAuthorMapper.insert(author);
    }

    @Override
    public void del(Integer id) {
        iTbAuthorMapper.deleteById(id);
    }

    @Override
    public void set(TbAuthor author) {
        iTbAuthorMapper.updateById(author);
    }

    @Override
    public TbAuthor getById(Integer id) {
        return iTbAuthorMapper.selectById(id);
    }
}
